package cn.zucc.edu.handyzucc.dao;

import cn.zucc.edu.handyzucc.entity.Follow;
import cn.zucc.edu.handyzucc.entity.Post;
import cn.zucc.edu.handyzucc.entity.PostFavorite;
import cn.zucc.edu.handyzucc.entity.PostVote;

import java.util.List;

public interface PostDao {
    List<Post> getAllPosts();
    List<Post> getPostsByAuthor(Integer post_author);
    List<Post> getPostsByFollow(Integer follow_follower);
    List<Post> getFavoritePosts(Integer postfavorite_userid);
    List<Post> getPostsByKeyword(String keyword);
    int addPost(Post post);
    int deletePost(Integer post_id);
    int deletePostInAdmin(Integer post_id);
    int deleteFavoritePostInAdmin(Integer postfavorite_postid);
    int deletePostVoteInAdmin(Integer postvote_postid);
    int deleteFavoritePost(Integer postfavorite_postid, Integer postfavorite_userid);
    Post getPostDetail(Integer post_id);
    Follow ifAlreadyFollow(Integer follow_leader, Integer follow_follower);
    PostVote getPostVote(Integer post_id, Integer user_id);
    PostFavorite getPostFavorite(Integer post_id, Integer user_id);
    int addFollow(Follow follow);
    int cancelFollow(Integer follow_leader, Integer follow_follower);
    int addPostVote(PostVote postVote);
    int cancelPostVote(Integer post_id, Integer user_id);
    int addPostFavorite(PostFavorite postFavorite);
    int cancelPostFavorite(Integer post_id, Integer user_id);
    int updatePostVotes(Integer post_id, Integer step);
    int updatePostComments(Integer post_id, Integer step);
    int updatePostFavorites(Integer post_id, Integer step);
}
